fix(tagLabel): lenient appliedAt date deserialization#27771
fix(tagLabel): lenient appliedAt date deserialization#27771Khairajani wants to merge 5 commits intomainfrom
Conversation
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Accept ISO-8601 datetimes with or without fractional seconds for
TagLabel.appliedAt. Python clients omit fractional when a datetime's
microsecond is zero, emitting strings like "2026-04-24T10:27:06Z" that
the strict global SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'")
rejects, causing PATCH operations to fail with "Failed to convert
JsonValue to target class".
22c5e27 to
5788f98
Compare
🔴 Playwright Results — 19 failure(s), 15 flaky✅ 3941 passed · ❌ 19 failed · 🟡 15 flaky · ⏭️ 86 skipped
Genuine Failures (failed on all attempts)❌
|
…ption JsonUtils.readValue catches JsonProcessingException and rethrows as JsonParsingException, so the public-API caller observes the wrapper. Assert on the wrapper type and verify the cause chain carries the underlying Jackson mapping exception with the field path context.
Code Review ✅ Approved 1 resolved / 1 findingsUpdates tagLabel deserialization to use LenientIsoDateDeserializer, resolving the unhandled DateTimeParseException. The implementation is robust and no further issues were found. ✅ 1 resolved✅ Edge Case: LenientIsoDateDeserializer doesn't wrap DateTimeParseException
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|



Summary
TagLabel.appliedAtis typedjava.util.Dateand the global JacksonObjectMapperis configured withSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'")— which strictly requires 6-digit fractional seconds on parse. Python clients using Pydantic emit datetimes viadatetime.isoformat(), which omits the fractional part entirely whenmicrosecond == 0(~1/1000 odds per timestamp). The result is a payload like"2026-04-24T10:27:06Z"that the server cannot deserialize, surfacing as:This was causing intermittent automator propagation failures in CI — every PATCH carrying a round-tripped
appliedAtwithmicrosecond=0was being rejected. Same class of bug as thetag_usage.appliedAtprecision fix in the 1.11.8 / 1.12.0 MySQL migrations, just on the wire side.Fix
Register a Jackson mixin on
TagLabelthat deserializesappliedAtviaInstant.parse(), which accepts both forms:"2026-04-24T10:27:06Z"(no fractional)"2026-04-24T10:27:06.918000Z"(with fractional)Mixin is added to the global
OBJECT_MAPPERbefore any.copy(), so all five derived mappers inherit it. No generated code is touched. Serialization is unchanged (still always emits 6-digit fractional from the global format).Test plan
JsonUtilsTest#testTagLabelAppliedAtAcceptsBareSecondPrecisioncovering both formsmvn compile -pl openmetadata-specpassesmvn spotless:applyclean